package com.hnevc.xiewenguang;

import java.util.Scanner;

public class Example03 {
    public static int maxNum(int[] intArrays){
        int max = intArrays[0];//保存最大值
        for (int j = 0; j < intArrays.length; j++) {
            if (max < intArrays[j]) {
                max = intArrays[j];
            }
        }
        return max;
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[] intArrays = new int[10];
        for (int i = 0; i < intArrays.length; i++) {
            System.out.printf("输入第%d个值:",i+1);
            intArrays[i] = in.nextInt();
        }

        //得到最大值
        int max =maxNum(intArrays);
        System.out.println(max);

    }

}


